/*
  User: Yemao Luo
  Date: 2021/10/22
  Time: 13:41
*/

import java.util.ArrayList;
import java.util.Scanner;

public class Class06HW {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String input = sc.next();
        Stack stack1 = new Stack();
        Stack stack2 = new Stack();
        stack1.setData(input);
        System.out.print("1：");
        stack1.getData();
        System.out.println();
        System.out.print("2：");
        stack2.setData(stack1.returnStr());
        stack2.getData();
    }
}

class Stack{
    private ArrayList<Integer> data = new ArrayList<>();

    public void setData(String input){
        for (int i = 0; i < input.length(); i++) {
            data.add(Integer.parseInt(String.valueOf(input.charAt(i))));
        }
    }

    public void getData(){
        for (int i = data.size() - 1; i >= 0; i--) {
            System.out.print(data.get(i));
            if (i != 0){
                System.out.print(" -> ");
            }
        }
    }

    public String returnStr(){
        String ret = "";
        for (int i = data.size() - 1; i >= 0; i--) {
            ret += String.valueOf(data.get(i));
        }
        return ret;
    }
}
